package com.jsbj.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsbj.user.entities.SysOrg;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 组织结构表（集团-公司-项目-标段） Mapper 接口
 * </p>
 *
 * @author jsbj
 * @since 2022-03-07
 */
@Mapper
public interface SysOrgMapper extends BaseMapper<SysOrg> {

    List<SysOrg> getInfoByUserIdAndTenantCode(@Param("userId") String userId,@Param("tenantCode") String tenantCode);

    List<SysOrg> getSGInfoByTenatCode(@Param("userId") String userId,@Param("tenantCode") String tenantCode);

    List<SysOrg> getTestUnitByUserIdAndTenantCode(@Param("userId") String userId,@Param("tenantCode") String tenantCode,@Param("secType") String secType);

    List<SysOrg> getTestUnitByTenantCodeAndOrgCode(@Param("tenantCode") String tenantCode,@Param("orgCode") String orgCode);

    List<String> selectQXOrgCode(@Param("userId")String userId);

    List<String> selectOrgCodeByName(@Param("orgName")String orgName);

    List<SysOrg> getByCondition(Map<String,Object> params);

    List<String> selectQXOrgCodeAndCreate(@Param("userId")String userId);

    IPage<Map<String, Object>> getOrgListPage(Page<Map<String, Object>> page, Map<String, Object> params);

    List<Map<String, Object>> getOrgListByUserIdAndOrgName(Map<String, Object> params);

    List<Map<String, Object>> getTenantListByUserIdAndOrgName(Map<String, Object> params);
}
